<template>
  <div>
    <!-- table -->
    <FormPanel ref="formPanel" :list="formList1" :cols="1" :formType="'add'" labelWidth="110" :isSubmitBtn="false" />
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <multiuse-button type="primary" :click="saveDialog.bind()">保 存</multiuse-button>
      <multiuse-button @click="closeDialog">关 闭</multiuse-button>
    </div>
  </div>
</template>
<script>
// import res from '@/mock/tableData';
export default {
  data() {
    return {
      dataList1: [],
      visible: false,
      visibleDrawer: false,
      collapse: false,
      infoId: null,
      flterValue: {}, //参数
      fetchParams: {}, //ipa 接口
      selectedRows: [], //选中经销商
      formList1: this.createFormList1(),
      saveData: null,
      activeName: '审核记录',
    };
  },
  created() {
    // this.dataList = [...res.data.items];
    this.dataList1 = [...res.data.items];
    console.log(this.dataList);
  },
  methods: {
    formChangeHandle(val) {
      console.log(val);
      this.saveData = val;
    },
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = val;
      console.log(val);
    },
    // //选中
    // selectChange(rows) {
    //   this.selectedRows = rows;
    //   console.log(this.selectedRows);
    // },
    //保存
    saveDialog() {
      this.$refs.formPanel1.SUBMIT_FORM();
      if (this.saveData) {
        this.$emit('save', this.selectedRows);
      }
    },
    //取消操作
    closeDialog() {
      this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
    },
    chooseOrderNo() {
      this.visible = true;
    },
    add() {},
    createFormList1() {
      return [
        {
          type: 'SELECT',
          label: '系统',
          fieldName: 'faSys',
          itemList: [{ text: '热点', value: '1' }, { text: '资讯', value: '2' }],
          rules: [{ required: true, message: '请选择系统系统', trigger: 'change' }],
          editRequired: true
        },
        {
          type: 'INPUT',
          label: '系统代码',
          fieldName: 'sysCode',
          placeholder: '请输入标题名称...',
          rules: [{ required: true, message: '请输入系统代码', trigger: 'blur' }, { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }],
          editRequired: true
        },
        {
          type: 'INPUT',
          label: '系统名称',
          fieldName: 'sysName',
          placeholder: '请输入标题名称...',
          rules: [{ required: true, message: '请输入系统名称', trigger: 'blur' }, { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }],
          editRequired: true
        },
        {
          type: 'INPUT',
          label: '故障原因',
          fieldName: 'faName',
          placeholder: '请输入标题名称...',
          rules: [{ required: true, message: '请输入故障原因', trigger: 'blur' }, { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }],
          editRequired: true
        }
      ];
    }
  }
};
</script>

<style lang="less" scoped></style>
